// 这个是原生的tab切换 点击进行切换装置
var logo = document.querySelectorAll(".logo a")
var logo_cot = document.querySelectorAll(".logo a ul")
for (var i = 0; i < logo.length; i++) {
    logo[i].dom = logo_cot[i]
    logo[i].onclick = function () {
        for (var i = 0; i < logo.length; i++) {
            logo_cot[i].style.display = "none";
        }
        this.dom.style.display = "block";
        $(this).addClass("active").siblings().removeClass("active");
    }
}

// 这是点击直接进入头部的
window.onscroll = function () { scrollFunction() };
function scrollFunction() {
    if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
        document.querySelector(" .shoptop .top").style.display = "block";
    } else {
        document.querySelector(" .shoptop .top").style.display = "none";
    }
}
function topFunction() {
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}


//请求购买第5个页面的请求数据 
//get的请求 
function empont4(callBack1) {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", "../../api/emption4data.json");
    xhr.send();
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4) {
            callBack1(JSON.parse(xhr.responseText));
        }
    }
}



homeshop()



